/**
 * @import libs
 */
import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useShoppingStaticMessStore = defineStore('shoppingStaticMess', () => {

    /**
     * 商品类型列表
     * @type {Array<{id: number, name: string}>}}
     */
    let goodTypeList = ref([
        {
            id: 0,
            name: "饼干类",
            keyWords:['饼干']
        },
        {
            id: 1,
            name: "冲调类",
            keyWords:['冲调','米稀']
        },
        {
            id: 2,
            name: "冻干类",
            keyWords:['冻干','饼干']
        },
        {
            id: 3,
            name: "磨牙棒类",
            keyWords:['磨牙棒','饼干']
        }
    ])

    /**
     * 商品列表
     * @type {Array<{id: number, name: string, price: number, imgUrl: string, buyCount: number}>}
     */
    let goodsList = ref([
        {
            id: 0,
            name: "荞宠宠物能量饼干",
            price: 29.9,
            imgUrl: "/static/imgs/goods_img_1.png",
            buyCount: 200,

        }, {
            id: 1,
            name: "荞宠宠物营养米稀",
            price: 35,
            imgUrl: "/static/imgs/goods_img_2.png",
            buyCount: 500,

        }, {
            id: 2,
            name: "荞宠宠物营养米稀",
            price: 35,
            imgUrl: "/static/imgs/goods_img_3.png",
            buyCount: 200,
        }, {
            id: 3,
            name: "荞宠宠物能量饼干",
            price: 29.9,
            imgUrl: "/static/imgs/goods_img_4.png",
            buyCount: 800
        }, {
            id: 4,
            name: "荞宠宠物能量饼干",
            price: 39.9,
            imgUrl: "/static/imgs/goods_img_5.png",
            buyCount: 200
        }, {
            id: 5,
            name: "荞宠宠物营养米稀",
            price: 35,
            imgUrl: "/static/imgs/goods_img_6.png",
            buyCount: 200
        }
    ])

    /**
     * 当前展示的商品列表
     */
    let currentGoodsList = ref([...goodsList.value]);

    return {
        goodTypeList,
        goodsList,
        currentGoodsList
    }
})